interface MyArr{
    name:string,
    age:number
}
class Greeter{
    greeterIndex:string;
    age:number;
  
    constructor(message:string,age?:number){
        this.greeterIndex=message;
        this.age=age as number
    }
    greet(params:MyArr){
        console.log(params,"111");
    }
    greets(){
        return "姓名"+this.greeterIndex
    }
}
let greeter=new Greeter("年龄")
console.log(greeter.greets(),222);

console.log(greeter.greet({
    age:20,
    name:"溜溜"
}),333);
